package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.Subnet;
import com.bocloud.common.model.Param;
import com.bocloud.common.model.SimpleBean;

/**
 * 子网DAO接口
 * 
 * @author dongkai
 *
 */
public interface SubnetDao {

	/**
	 * 分页查询
	 * 
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<Subnet> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 简易查询
	 * 
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<SimpleBean> list(List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 根据VendorId和networkId查询
	 * 
	 * @param vendorId
	 * @param networkId
	 * @return
	 * @throws Exception
	 */
	public List<Subnet> list(Long vendorId, String networkId) throws Exception;

	/**
	 * 根据VendorId查询
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public List<Subnet> listByVid(Long vendorId) throws Exception;

	/**
	 * 根据参数查询
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;

	/**
	 * 保存
	 * 
	 * @param subnet
	 * @return
	 * @throws Exception
	 */
	public Subnet save(Subnet subnet) throws Exception;

	/**
	 * 修改
	 * 
	 * @param subnet
	 * @return
	 * @throws Exception
	 */
	public boolean modify(Subnet subnet) throws Exception;

	/**
	 * 删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public boolean delete(Long id) throws Exception;

	/**
	 * 根据VendorId删除
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public boolean removeByVid(Long vendorId) throws Exception;

	/**
	 * 根据ID查询
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Subnet query(Long id) throws Exception;
}
